import {
    INCREMENTCOUNT,
    DECREMENTCOUNT
} from '../constnant/countConst' //引入常量

import store from '../store' //引入store发送dispatch

//累加的action
export const incrementAction = (data) => {
    return {
        type: INCREMENTCOUNT,
        data
    }
}

//累减的action
export const decrementAction = (data = 1) => {
    return {
        type: DECREMENTCOUNT,
        data
    }
}

//异步的action
export const waitincrementAction = (data) => {
    return () => {
        setTimeout(() => {
            store.dispatch({
                type: INCREMENTCOUNT,
                data
            })
        }, 2000);
    }
}


